<div class="block">

    <div class="block_head">
        <div class="bheadl"></div>
        <div class="bheadr"></div>

        <h2>Danh sách tin tức</h2>
        <ul>
            <li><a href="cms/news/add">Thêm mới</a></li>
        </ul>

    </div>		<!-- .block_head ends -->



    <div class="block_content">

        <form action="" method="post">

            <table cellpadding="0" cellspacing="0" width="100%" class="sortable">

                <thead>
                <tr>
                    <th>ID</th>
                    <th>Tiêu đề</th>
                    <th>Nội dung</th>
                    <th>Ảnh</th>
                    <th>Kiểu</th>
					<th>Trạng thái</th>
                    <th>Ghi chú</th>
                    <th colspan="2">Thao tác</th>
                </tr>
                </thead>

                <tbody>
	<?php if($rows):foreach($rows as $row):?>
			<tr>
	<?php foreach($fields as $field_name => $field_display): ?>

	<?php if($field_name == "image"){
		if($row->$field_name != ""){
			echo '<td><img src="uploads/news/'.$row->$field_name.'" width="60" height="60" border="0" /></td>';
		} else {
			echo '<td></td>';
		}
	} elseif($field_name == "type"){
		if($row->$field_name == 1){
			echo '<td>Thể lệ</td>';
		} else {
			echo '<td>Tin tức</td>';
		}
	} elseif($field_name == "status"){
		if($row->$field_name == 0){
			echo '<td>Ẩn</td>';
		} else {
			echo '<td>Hiện</td>';
		}
	} else {
		echo '<td>'.$row->$field_name.'</td>';
} ?>

<?php endforeach; ?>
<td class="edit"><a href="cms/news/edit/<?php echo $row->news_id; ?>">Sửa</a></td>
<td class="edit"><a href="cms/news/delete/<?php echo $row->news_id; ?>">Xóa</a></td>
	</tr>
<?php endforeach; else:?>
	<tr><td colspan="5">Hiện chưa có dữ liệu</td></tr>
<?php endif;?>
                </tbody>

            </table>

            <div class="pagination right">
<?php if(strlen($pagination)): ?>
Page : <?php echo $pagination; ?>
<?php endif; ?>
            </div>		<!-- .pagination ends -->

        </form>

    </div>		<!-- .block_content ends -->

    <div class="bendl"></div>
    <div class="bendr"></div>
</div>		<!-- .block ends -->